3.5.66 \(\int \frac {\cot ^4(c+d x)}{a+b \tan (c+d x)} \, dx\) [466]

3.5.66.1 Optimal result
3.5.66.2 Mathematica [C] (verified)
3.5.66.3 Rubi [A] (verified)
3.5.66.4 Maple [A] (verified)
3.5.66.5 Fricas [A] (verification not implemented)
3.5.66.6 Sympy [C] (verification not implemented)
3.5.66.7 Maxima [A] (verification not implemented)
3.5.66.8 Giac [A] (verification not implemented)
3.5.66.9 Mupad [B] (verification not implemented)

3.5.66.1 Optimal result

Integrand size = 21, antiderivative size = 133 \[ \int \frac {\cot ^4(c+d x)}{a+b \tan (c+d x)} \, dx=\frac {a x}{a^2+b^2}+\frac {\left (a^2-b^2\right ) \cot (c+d x)}{a^3 d}+\frac {b \cot ^2(c+d x)}{2 a^2 d}-\frac {\cot ^3(c+d x)}{3 a d}+\frac {b \left (a^2-b^2\right ) \log (\sin (c+d x))}{a^4 d}+\frac {b^5 \log (a \cos (c+d x)+b \sin (c+d x))}{a^4 \left (a^2+b^2\right ) d} \]

output
a*x/(a^2+b^2)+(a^2-b^2)*cot(d*x+c)/a^3/d+1/2*b*cot(d*x+c)^2/a^2/d-1/3*cot( 
d*x+c)^3/a/d+b*(a^2-b^2)*ln(sin(d*x+c))/a^4/d+b^5*ln(a*cos(d*x+c)+b*sin(d* 
x+c))/a^4/(a^2+b^2)/d
 
3.5.66.2 Mathematica [C] (verified)

Result contains complex when optimal does not.

Time = 1.65 (sec) , antiderivative size = 131, normalized size of antiderivative = 0.98 \[ \int \frac {\cot ^4(c+d x)}{a+b \tan (c+d x)} \, dx=-\frac {-\frac {6 \left (a^2-b^2\right ) \cot (c+d x)}{a^3}-\frac {3 b \cot ^2(c+d x)}{a^2}+\frac {2 \cot ^3(c+d x)}{a}+\frac {3 \log (i-\cot (c+d x))}{i a+b}+\frac {3 i \log (i+\cot (c+d x))}{a+i b}-\frac {6 b^5 \log (b+a \cot (c+d x))}{a^4 \left (a^2+b^2\right )}}{6 d} \]

input
Integrate[Cot[c + d*x]^4/(a + b*Tan[c + d*x]),x]
 
output
-1/6*((-6*(a^2 - b^2)*Cot[c + d*x])/a^3 - (3*b*Cot[c + d*x]^2)/a^2 + (2*Co 
t[c + d*x]^3)/a + (3*Log[I - Cot[c + d*x]])/(I*a + b) + ((3*I)*Log[I + Cot 
[c + d*x]])/(a + I*b) - (6*b^5*Log[b + a*Cot[c + d*x]])/(a^4*(a^2 + b^2))) 
/d
 
3.5.66.3 Rubi [A] (verified)

Time = 1.13 (sec) , antiderivative size = 155, normalized size of antiderivative = 1.17, number of steps used = 14, number of rules used = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.667, Rules used = {3042, 4052, 27, 3042, 4132, 27, 3042, 4133, 3042, 4134, 3042, 25, 3956, 4013}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {\cot ^4(c+d x)}{a+b \tan (c+d x)} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {1}{\tan (c+d x)^4 (a+b \tan (c+d x))}dx\)

\(\Big \downarrow \) 4052

\(\displaystyle -\frac {\int \frac {3 \cot ^3(c+d x) \left (b \tan ^2(c+d x)+a \tan (c+d x)+b\right )}{a+b \tan (c+d x)}dx}{3 a}-\frac {\cot ^3(c+d x)}{3 a d}\)

\(\Big \downarrow \) 27

\(\displaystyle -\frac {\int \frac {\cot ^3(c+d x) \left (b \tan ^2(c+d x)+a \tan (c+d x)+b\right )}{a+b \tan (c+d x)}dx}{a}-\frac {\cot ^3(c+d x)}{3 a d}\)

\(\Big \downarrow \) 3042

\(\displaystyle -\frac {\int \frac {b \tan (c+d x)^2+a \tan (c+d x)+b}{\tan (c+d x)^3 (a+b \tan (c+d x))}dx}{a}-\frac {\cot ^3(c+d x)}{3 a d}\)

\(\Big \downarrow \) 4132

\(\displaystyle -\frac {-\frac {\int -\frac {2 \cot ^2(c+d x) \left (a^2-b^2-b^2 \tan ^2(c+d x)\right )}{a+b \tan (c+d x)}dx}{2 a}-\frac {b \cot ^2(c+d x)}{2 a d}}{a}-\frac {\cot ^3(c+d x)}{3 a d}\)

\(\Big \downarrow \) 27

\(\displaystyle -\frac {\frac {\int \frac {\cot ^2(c+d x) \left (a^2-b^2-b^2 \tan ^2(c+d x)\right )}{a+b \tan (c+d x)}dx}{a}-\frac {b \cot ^2(c+d x)}{2 a d}}{a}-\frac {\cot ^3(c+d x)}{3 a d}\)

\(\Big \downarrow \) 3042

\(\displaystyle -\frac {\frac {\int \frac {a^2-b^2-b^2 \tan (c+d x)^2}{\tan (c+d x)^2 (a+b \tan (c+d x))}dx}{a}-\frac {b \cot ^2(c+d x)}{2 a d}}{a}-\frac {\cot ^3(c+d x)}{3 a d}\)

\(\Big \downarrow \) 4133

\(\displaystyle -\frac {\frac {-\frac {\int \frac {\cot (c+d x) \left (\tan (c+d x) a^3+b \left (a^2-b^2\right ) \tan ^2(c+d x)+b \left (a^2-b^2\right )\right )}{a+b \tan (c+d x)}dx}{a}-\frac {\left (a^2-b^2\right ) \cot (c+d x)}{a d}}{a}-\frac {b \cot ^2(c+d x)}{2 a d}}{a}-\frac {\cot ^3(c+d x)}{3 a d}\)

\(\Big \downarrow \) 3042

\(\displaystyle -\frac {\frac {-\frac {\int \frac {\tan (c+d x) a^3+b \left (a^2-b^2\right ) \tan (c+d x)^2+b \left (a^2-b^2\right )}{\tan (c+d x) (a+b \tan (c+d x))}dx}{a}-\frac {\left (a^2-b^2\right ) \cot (c+d x)}{a d}}{a}-\frac {b \cot ^2(c+d x)}{2 a d}}{a}-\frac {\cot ^3(c+d x)}{3 a d}\)

\(\Big \downarrow \) 4134

\(\displaystyle -\frac {\frac {-\frac {\frac {b \left (a^2-b^2\right ) \int \cot (c+d x)dx}{a}+\frac {b^5 \int \frac {b-a \tan (c+d x)}{a+b \tan (c+d x)}dx}{a \left (a^2+b^2\right )}+\frac {a^4 x}{a^2+b^2}}{a}-\frac {\left (a^2-b^2\right ) \cot (c+d x)}{a d}}{a}-\frac {b \cot ^2(c+d x)}{2 a d}}{a}-\frac {\cot ^3(c+d x)}{3 a d}\)

\(\Big \downarrow \) 3042

\(\displaystyle -\frac {\frac {-\frac {\frac {b \left (a^2-b^2\right ) \int -\tan \left (c+d x+\frac {\pi }{2}\right )dx}{a}+\frac {b^5 \int \frac {b-a \tan (c+d x)}{a+b \tan (c+d x)}dx}{a \left (a^2+b^2\right )}+\frac {a^4 x}{a^2+b^2}}{a}-\frac {\left (a^2-b^2\right ) \cot (c+d x)}{a d}}{a}-\frac {b \cot ^2(c+d x)}{2 a d}}{a}-\frac {\cot ^3(c+d x)}{3 a d}\)

\(\Big \downarrow \) 25

\(\displaystyle -\frac {\frac {-\frac {-\frac {b \left (a^2-b^2\right ) \int \tan \left (\frac {1}{2} (2 c+\pi )+d x\right )dx}{a}+\frac {b^5 \int \frac {b-a \tan (c+d x)}{a+b \tan (c+d x)}dx}{a \left (a^2+b^2\right )}+\frac {a^4 x}{a^2+b^2}}{a}-\frac {\left (a^2-b^2\right ) \cot (c+d x)}{a d}}{a}-\frac {b \cot ^2(c+d x)}{2 a d}}{a}-\frac {\cot ^3(c+d x)}{3 a d}\)

\(\Big \downarrow \) 3956

\(\displaystyle -\frac {\frac {-\frac {\frac {b^5 \int \frac {b-a \tan (c+d x)}{a+b \tan (c+d x)}dx}{a \left (a^2+b^2\right )}+\frac {b \left (a^2-b^2\right ) \log (-\sin (c+d x))}{a d}+\frac {a^4 x}{a^2+b^2}}{a}-\frac {\left (a^2-b^2\right ) \cot (c+d x)}{a d}}{a}-\frac {b \cot ^2(c+d x)}{2 a d}}{a}-\frac {\cot ^3(c+d x)}{3 a d}\)

\(\Big \downarrow \) 4013

\(\displaystyle -\frac {\frac {-\frac {\left (a^2-b^2\right ) \cot (c+d x)}{a d}-\frac {\frac {b \left (a^2-b^2\right ) \log (-\sin (c+d x))}{a d}+\frac {b^5 \log (a \cos (c+d x)+b \sin (c+d x))}{a d \left (a^2+b^2\right )}+\frac {a^4 x}{a^2+b^2}}{a}}{a}-\frac {b \cot ^2(c+d x)}{2 a d}}{a}-\frac {\cot ^3(c+d x)}{3 a d}\)

input
Int[Cot[c + d*x]^4/(a + b*Tan[c + d*x]),x]
 
output
-1/3*Cot[c + d*x]^3/(a*d) - (-1/2*(b*Cot[c + d*x]^2)/(a*d) + (-(((a^2 - b^ 
2)*Cot[c + d*x])/(a*d)) - ((a^4*x)/(a^2 + b^2) + (b*(a^2 - b^2)*Log[-Sin[c 
 + d*x]])/(a*d) + (b^5*Log[a*Cos[c + d*x] + b*Sin[c + d*x]])/(a*(a^2 + b^2 
)*d))/a)/a)/a
 

3.5.66.3.1 Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3956
Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d 
*x], x]]/d, x] /; FreeQ[{c, d}, x]
 

rule 4013
Int[((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_) + (b_.)*tan[(e_.) + (f_.)* 
(x_)]), x_Symbol] :> Simp[(c/(b*f))*Log[RemoveContent[a*Cos[e + f*x] + b*Si 
n[e + f*x], x]], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && 
 NeQ[a^2 + b^2, 0] && EqQ[a*c + b*d, 0]
 

rule 4052
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + 
 (f_.)*(x_)])^(n_), x_Symbol] :> Simp[b^2*(a + b*Tan[e + f*x])^(m + 1)*((c 
+ d*Tan[e + f*x])^(n + 1)/(f*(m + 1)*(a^2 + b^2)*(b*c - a*d))), x] + Simp[1 
/((m + 1)*(a^2 + b^2)*(b*c - a*d))   Int[(a + b*Tan[e + f*x])^(m + 1)*(c + 
d*Tan[e + f*x])^n*Simp[a*(b*c - a*d)*(m + 1) - b^2*d*(m + n + 2) - b*(b*c - 
 a*d)*(m + 1)*Tan[e + f*x] - b^2*d*(m + n + 2)*Tan[e + f*x]^2, x], x], x] / 
; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] 
 && NeQ[c^2 + d^2, 0] && IntegerQ[2*m] && LtQ[m, -1] && (LtQ[n, 0] || Integ 
erQ[m]) &&  !(ILtQ[n, -1] && ( !IntegerQ[m] || (EqQ[c, 0] && NeQ[a, 0])))
 

rule 4132
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + 
 (f_.)*(x_)])^(n_)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) 
 + (f_.)*(x_)]^2), x_Symbol] :> Simp[(A*b^2 - a*(b*B - a*C))*(a + b*Tan[e + 
 f*x])^(m + 1)*((c + d*Tan[e + f*x])^(n + 1)/(f*(m + 1)*(b*c - a*d)*(a^2 + 
b^2))), x] + Simp[1/((m + 1)*(b*c - a*d)*(a^2 + b^2))   Int[(a + b*Tan[e + 
f*x])^(m + 1)*(c + d*Tan[e + f*x])^n*Simp[A*(a*(b*c - a*d)*(m + 1) - b^2*d* 
(m + n + 2)) + (b*B - a*C)*(b*c*(m + 1) + a*d*(n + 1)) - (m + 1)*(b*c - a*d 
)*(A*b - a*B - b*C)*Tan[e + f*x] - d*(A*b^2 - a*(b*B - a*C))*(m + n + 2)*Ta 
n[e + f*x]^2, x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B, C, n}, x] && NeQ 
[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] && LtQ[m, -1] && 
!(ILtQ[n, -1] && ( !IntegerQ[m] || (EqQ[c, 0] && NeQ[a, 0])))
 

rule 4133
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + 
 (f_.)*(x_)])^(n_)*((A_.) + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> 
Simp[(A*b^2 + a^2*C)*(a + b*Tan[e + f*x])^(m + 1)*((c + d*Tan[e + f*x])^(n 
+ 1)/(f*(m + 1)*(b*c - a*d)*(a^2 + b^2))), x] + Simp[1/((m + 1)*(b*c - a*d) 
*(a^2 + b^2))   Int[(a + b*Tan[e + f*x])^(m + 1)*(c + d*Tan[e + f*x])^n*Sim 
p[A*(a*(b*c - a*d)*(m + 1) - b^2*d*(m + n + 2)) - a*C*(b*c*(m + 1) + a*d*(n 
 + 1)) - (m + 1)*(b*c - a*d)*(A*b - b*C)*Tan[e + f*x] - d*(A*b^2 + a^2*C)*( 
m + n + 2)*Tan[e + f*x]^2, x], x], x] /; FreeQ[{a, b, c, d, e, f, A, C, n}, 
 x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] && LtQ[m 
, -1] &&  !(ILtQ[n, -1] && ( !IntegerQ[m] || (EqQ[c, 0] && NeQ[a, 0])))
 

rule 4134
Int[((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (f_.)*(x_)]^ 
2)/(((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.) 
*(x_)])), x_Symbol] :> Simp[(a*(A*c - c*C + B*d) + b*(B*c - A*d + C*d))*(x/ 
((a^2 + b^2)*(c^2 + d^2))), x] + (Simp[(A*b^2 - a*b*B + a^2*C)/((b*c - a*d) 
*(a^2 + b^2))   Int[(b - a*Tan[e + f*x])/(a + b*Tan[e + f*x]), x], x] - Sim 
p[(c^2*C - B*c*d + A*d^2)/((b*c - a*d)*(c^2 + d^2))   Int[(d - c*Tan[e + f* 
x])/(c + d*Tan[e + f*x]), x], x]) /; FreeQ[{a, b, c, d, e, f, A, B, C}, x] 
&& NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0]
 
3.5.66.4 Maple [A] (verified)

Time = 0.56 (sec) , antiderivative size = 137, normalized size of antiderivative = 1.03

method result size
derivativedivides \(\frac {\frac {b^{5} \ln \left (a +b \tan \left (d x +c \right )\right )}{a^{4} \left (a^{2}+b^{2}\right )}-\frac {1}{3 a \tan \left (d x +c \right )^{3}}-\frac {-a^{2}+b^{2}}{a^{3} \tan \left (d x +c \right )}+\frac {b \left (a^{2}-b^{2}\right ) \ln \left (\tan \left (d x +c \right )\right )}{a^{4}}+\frac {b}{2 a^{2} \tan \left (d x +c \right )^{2}}+\frac {-\frac {b \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2}+a \arctan \left (\tan \left (d x +c \right )\right )}{a^{2}+b^{2}}}{d}\) \(137\)
default \(\frac {\frac {b^{5} \ln \left (a +b \tan \left (d x +c \right )\right )}{a^{4} \left (a^{2}+b^{2}\right )}-\frac {1}{3 a \tan \left (d x +c \right )^{3}}-\frac {-a^{2}+b^{2}}{a^{3} \tan \left (d x +c \right )}+\frac {b \left (a^{2}-b^{2}\right ) \ln \left (\tan \left (d x +c \right )\right )}{a^{4}}+\frac {b}{2 a^{2} \tan \left (d x +c \right )^{2}}+\frac {-\frac {b \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2}+a \arctan \left (\tan \left (d x +c \right )\right )}{a^{2}+b^{2}}}{d}\) \(137\)
norman \(\frac {\frac {a x \left (\tan ^{3}\left (d x +c \right )\right )}{a^{2}+b^{2}}+\frac {\left (a^{2}-b^{2}\right ) \left (\tan ^{2}\left (d x +c \right )\right )}{a^{3} d}-\frac {1}{3 a d}+\frac {b \tan \left (d x +c \right )}{2 a^{2} d}}{\tan \left (d x +c \right )^{3}}+\frac {b \left (a^{2}-b^{2}\right ) \ln \left (\tan \left (d x +c \right )\right )}{d \,a^{4}}+\frac {b^{5} \ln \left (a +b \tan \left (d x +c \right )\right )}{\left (a^{2}+b^{2}\right ) d \,a^{4}}-\frac {b \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2 d \left (a^{2}+b^{2}\right )}\) \(159\)
parallelrisch \(\frac {-2 \left (\cot ^{3}\left (d x +c \right )\right ) a^{5}-2 \left (\cot ^{3}\left (d x +c \right )\right ) a^{3} b^{2}+3 \left (\cot ^{2}\left (d x +c \right )\right ) a^{4} b +3 \left (\cot ^{2}\left (d x +c \right )\right ) a^{2} b^{3}+6 x \,a^{5} d +6 \cot \left (d x +c \right ) a^{5}-6 \cot \left (d x +c \right ) a \,b^{4}+6 \ln \left (a +b \tan \left (d x +c \right )\right ) b^{5}+6 \ln \left (\tan \left (d x +c \right )\right ) a^{4} b -6 \ln \left (\tan \left (d x +c \right )\right ) b^{5}-3 \ln \left (\sec ^{2}\left (d x +c \right )\right ) a^{4} b}{6 \left (a^{2}+b^{2}\right ) d \,a^{4}}\) \(164\)
risch \(-\frac {x}{i b -a}-\frac {2 i b x}{a^{2}}-\frac {2 i b c}{a^{2} d}+\frac {2 i b^{3} x}{a^{4}}+\frac {2 i b^{3} c}{d \,a^{4}}-\frac {2 i b^{5} x}{\left (a^{2}+b^{2}\right ) a^{4}}-\frac {2 i b^{5} c}{\left (a^{2}+b^{2}\right ) d \,a^{4}}-\frac {2 i \left (-3 i a b \,{\mathrm e}^{4 i \left (d x +c \right )}-6 a^{2} {\mathrm e}^{4 i \left (d x +c \right )}+3 b^{2} {\mathrm e}^{4 i \left (d x +c \right )}+3 i a b \,{\mathrm e}^{2 i \left (d x +c \right )}+6 a^{2} {\mathrm e}^{2 i \left (d x +c \right )}-6 b^{2} {\mathrm e}^{2 i \left (d x +c \right )}-4 a^{2}+3 b^{2}\right )}{3 d \,a^{3} \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{3}}+\frac {b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{a^{2} d}-\frac {b^{3} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{d \,a^{4}}+\frac {b^{5} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {i b +a}{i b -a}\right )}{\left (a^{2}+b^{2}\right ) d \,a^{4}}\) \(306\)

input
int(cot(d*x+c)^4/(a+b*tan(d*x+c)),x,method=_RETURNVERBOSE)
 
output
1/d*(b^5/a^4/(a^2+b^2)*ln(a+b*tan(d*x+c))-1/3/a/tan(d*x+c)^3-(-a^2+b^2)/a^ 
3/tan(d*x+c)+b*(a^2-b^2)/a^4*ln(tan(d*x+c))+1/2/a^2*b/tan(d*x+c)^2+1/(a^2+ 
b^2)*(-1/2*b*ln(1+tan(d*x+c)^2)+a*arctan(tan(d*x+c))))
 
3.5.66.5 Fricas [A] (verification not implemented)

Time = 0.27 (sec) , antiderivative size = 207, normalized size of antiderivative = 1.56 \[ \int \frac {\cot ^4(c+d x)}{a+b \tan (c+d x)} \, dx=\frac {3 \, b^{5} \log \left (\frac {b^{2} \tan \left (d x + c\right )^{2} + 2 \, a b \tan \left (d x + c\right ) + a^{2}}{\tan \left (d x + c\right )^{2} + 1}\right ) \tan \left (d x + c\right )^{3} - 2 \, a^{5} - 2 \, a^{3} b^{2} + 3 \, {\left (a^{4} b - b^{5}\right )} \log \left (\frac {\tan \left (d x + c\right )^{2}}{\tan \left (d x + c\right )^{2} + 1}\right ) \tan \left (d x + c\right )^{3} + 3 \, {\left (2 \, a^{5} d x + a^{4} b + a^{2} b^{3}\right )} \tan \left (d x + c\right )^{3} + 6 \, {\left (a^{5} - a b^{4}\right )} \tan \left (d x + c\right )^{2} + 3 \, {\left (a^{4} b + a^{2} b^{3}\right )} \tan \left (d x + c\right )}{6 \, {\left (a^{6} + a^{4} b^{2}\right )} d \tan \left (d x + c\right )^{3}} \]

input
integrate(cot(d*x+c)^4/(a+b*tan(d*x+c)),x, algorithm="fricas")
 
output
1/6*(3*b^5*log((b^2*tan(d*x + c)^2 + 2*a*b*tan(d*x + c) + a^2)/(tan(d*x + 
c)^2 + 1))*tan(d*x + c)^3 - 2*a^5 - 2*a^3*b^2 + 3*(a^4*b - b^5)*log(tan(d* 
x + c)^2/(tan(d*x + c)^2 + 1))*tan(d*x + c)^3 + 3*(2*a^5*d*x + a^4*b + a^2 
*b^3)*tan(d*x + c)^3 + 6*(a^5 - a*b^4)*tan(d*x + c)^2 + 3*(a^4*b + a^2*b^3 
)*tan(d*x + c))/((a^6 + a^4*b^2)*d*tan(d*x + c)^3)
 
3.5.66.6 Sympy [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 2.78 (sec) , antiderivative size = 1533, normalized size of antiderivative = 11.53 \[ \int \frac {\cot ^4(c+d x)}{a+b \tan (c+d x)} \, dx=\text {Too large to display} \]

input
integrate(cot(d*x+c)**4/(a+b*tan(d*x+c)),x)
 
output
Piecewise((zoo*x, Eq(a, 0) & Eq(b, 0) & Eq(c, 0) & Eq(d, 0)), ((x - cot(c 
+ d*x)**3/(3*d) + cot(c + d*x)/d)/a, Eq(b, 0)), ((-log(tan(c + d*x)**2 + 1 
)/(2*d) + log(tan(c + d*x))/d + 1/(2*d*tan(c + d*x)**2) - 1/(4*d*tan(c + d 
*x)**4))/b, Eq(a, 0)), (15*d*x*tan(c + d*x)**4/(6*a*d*tan(c + d*x)**4 + 6* 
I*a*d*tan(c + d*x)**3) + 15*I*d*x*tan(c + d*x)**3/(6*a*d*tan(c + d*x)**4 + 
 6*I*a*d*tan(c + d*x)**3) + 6*I*log(tan(c + d*x)**2 + 1)*tan(c + d*x)**4/( 
6*a*d*tan(c + d*x)**4 + 6*I*a*d*tan(c + d*x)**3) - 6*log(tan(c + d*x)**2 + 
 1)*tan(c + d*x)**3/(6*a*d*tan(c + d*x)**4 + 6*I*a*d*tan(c + d*x)**3) - 12 
*I*log(tan(c + d*x))*tan(c + d*x)**4/(6*a*d*tan(c + d*x)**4 + 6*I*a*d*tan( 
c + d*x)**3) + 12*log(tan(c + d*x))*tan(c + d*x)**3/(6*a*d*tan(c + d*x)**4 
 + 6*I*a*d*tan(c + d*x)**3) + 15*tan(c + d*x)**3/(6*a*d*tan(c + d*x)**4 + 
6*I*a*d*tan(c + d*x)**3) + 9*I*tan(c + d*x)**2/(6*a*d*tan(c + d*x)**4 + 6* 
I*a*d*tan(c + d*x)**3) + tan(c + d*x)/(6*a*d*tan(c + d*x)**4 + 6*I*a*d*tan 
(c + d*x)**3) - 2*I/(6*a*d*tan(c + d*x)**4 + 6*I*a*d*tan(c + d*x)**3), Eq( 
b, -I*a)), (15*d*x*tan(c + d*x)**4/(6*a*d*tan(c + d*x)**4 - 6*I*a*d*tan(c 
+ d*x)**3) - 15*I*d*x*tan(c + d*x)**3/(6*a*d*tan(c + d*x)**4 - 6*I*a*d*tan 
(c + d*x)**3) - 6*I*log(tan(c + d*x)**2 + 1)*tan(c + d*x)**4/(6*a*d*tan(c 
+ d*x)**4 - 6*I*a*d*tan(c + d*x)**3) - 6*log(tan(c + d*x)**2 + 1)*tan(c + 
d*x)**3/(6*a*d*tan(c + d*x)**4 - 6*I*a*d*tan(c + d*x)**3) + 12*I*log(tan(c 
 + d*x))*tan(c + d*x)**4/(6*a*d*tan(c + d*x)**4 - 6*I*a*d*tan(c + d*x)*...
 
3.5.66.7 Maxima [A] (verification not implemented)

Time = 0.31 (sec) , antiderivative size = 145, normalized size of antiderivative = 1.09 \[ \int \frac {\cot ^4(c+d x)}{a+b \tan (c+d x)} \, dx=\frac {\frac {6 \, b^{5} \log \left (b \tan \left (d x + c\right ) + a\right )}{a^{6} + a^{4} b^{2}} + \frac {6 \, {\left (d x + c\right )} a}{a^{2} + b^{2}} - \frac {3 \, b \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{2} + b^{2}} + \frac {6 \, {\left (a^{2} b - b^{3}\right )} \log \left (\tan \left (d x + c\right )\right )}{a^{4}} + \frac {3 \, a b \tan \left (d x + c\right ) + 6 \, {\left (a^{2} - b^{2}\right )} \tan \left (d x + c\right )^{2} - 2 \, a^{2}}{a^{3} \tan \left (d x + c\right )^{3}}}{6 \, d} \]

input
integrate(cot(d*x+c)^4/(a+b*tan(d*x+c)),x, algorithm="maxima")
 
output
1/6*(6*b^5*log(b*tan(d*x + c) + a)/(a^6 + a^4*b^2) + 6*(d*x + c)*a/(a^2 + 
b^2) - 3*b*log(tan(d*x + c)^2 + 1)/(a^2 + b^2) + 6*(a^2*b - b^3)*log(tan(d 
*x + c))/a^4 + (3*a*b*tan(d*x + c) + 6*(a^2 - b^2)*tan(d*x + c)^2 - 2*a^2) 
/(a^3*tan(d*x + c)^3))/d
 
3.5.66.8 Giac [A] (verification not implemented)

Time = 0.71 (sec) , antiderivative size = 187, normalized size of antiderivative = 1.41 \[ \int \frac {\cot ^4(c+d x)}{a+b \tan (c+d x)} \, dx=\frac {\frac {6 \, b^{6} \log \left ({\left | b \tan \left (d x + c\right ) + a \right |}\right )}{a^{6} b + a^{4} b^{3}} + \frac {6 \, {\left (d x + c\right )} a}{a^{2} + b^{2}} - \frac {3 \, b \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{2} + b^{2}} + \frac {6 \, {\left (a^{2} b - b^{3}\right )} \log \left ({\left | \tan \left (d x + c\right ) \right |}\right )}{a^{4}} - \frac {11 \, a^{2} b \tan \left (d x + c\right )^{3} - 11 \, b^{3} \tan \left (d x + c\right )^{3} - 6 \, a^{3} \tan \left (d x + c\right )^{2} + 6 \, a b^{2} \tan \left (d x + c\right )^{2} - 3 \, a^{2} b \tan \left (d x + c\right ) + 2 \, a^{3}}{a^{4} \tan \left (d x + c\right )^{3}}}{6 \, d} \]

input
integrate(cot(d*x+c)^4/(a+b*tan(d*x+c)),x, algorithm="giac")
 
output
1/6*(6*b^6*log(abs(b*tan(d*x + c) + a))/(a^6*b + a^4*b^3) + 6*(d*x + c)*a/ 
(a^2 + b^2) - 3*b*log(tan(d*x + c)^2 + 1)/(a^2 + b^2) + 6*(a^2*b - b^3)*lo 
g(abs(tan(d*x + c)))/a^4 - (11*a^2*b*tan(d*x + c)^3 - 11*b^3*tan(d*x + c)^ 
3 - 6*a^3*tan(d*x + c)^2 + 6*a*b^2*tan(d*x + c)^2 - 3*a^2*b*tan(d*x + c) + 
 2*a^3)/(a^4*tan(d*x + c)^3))/d
 
3.5.66.9 Mupad [B] (verification not implemented)

Time = 4.72 (sec) , antiderivative size = 153, normalized size of antiderivative = 1.15 \[ \int \frac {\cot ^4(c+d x)}{a+b \tan (c+d x)} \, dx=\frac {{\mathrm {cot}\left (c+d\,x\right )}^3\,\left (\frac {{\mathrm {tan}\left (c+d\,x\right )}^2\,\left (a^2-b^2\right )}{a^3}-\frac {1}{3\,a}+\frac {b\,\mathrm {tan}\left (c+d\,x\right )}{2\,a^2}\right )}{d}-\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )}{2\,d\,\left (b+a\,1{}\mathrm {i}\right )}+\frac {b^5\,\ln \left (a+b\,\mathrm {tan}\left (c+d\,x\right )\right )}{a^4\,d\,\left (a^2+b^2\right )}+\frac {b\,\ln \left (\mathrm {tan}\left (c+d\,x\right )\right )\,\left (a^2-b^2\right )}{a^4\,d}-\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )\,1{}\mathrm {i}}{2\,d\,\left (a+b\,1{}\mathrm {i}\right )} \]

input
int(cot(c + d*x)^4/(a + b*tan(c + d*x)),x)
 
output
(cot(c + d*x)^3*((tan(c + d*x)^2*(a^2 - b^2))/a^3 - 1/(3*a) + (b*tan(c + d 
*x))/(2*a^2)))/d - log(tan(c + d*x) + 1i)/(2*d*(a*1i + b)) - (log(tan(c + 
d*x) - 1i)*1i)/(2*d*(a + b*1i)) + (b^5*log(a + b*tan(c + d*x)))/(a^4*d*(a^ 
2 + b^2)) + (b*log(tan(c + d*x))*(a^2 - b^2))/(a^4*d)